//
//  TTChangeHandSizeViewCell.m
//  TaoTuo
//
//  Created by admin on 2019/12/18.
//  Copyright © 2019 admin. All rights reserved.
//

#import "TTChangeHandSizeViewCell.h"
#import "TTChangeHandSizePopView.h"

@interface TTChangeHandSizeViewCell ()

@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UIImageView *leftImageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *chargeLabel;
@property (weak, nonatomic) IBOutlet UILabel *moneyLabel;
@property (weak, nonatomic) IBOutlet UILabel *currentLabel;


@end

@implementation TTChangeHandSizeViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.bgView.layer.cornerRadius = 5;
    self.bgView.layer.shadowColor = UIColorHex(6822B7).CGColor;
    self.bgView.layer.shadowOffset = CGSizeZero;
    self.bgView.layer.shadowOpacity = 0.2;
    self.bgView.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_WIDTH - 80, 40) cornerRadius:5].CGPath;
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    
}

- (void)setModel:(HandSizeModel *)model
{
    _model = model;
    
    UIImage *image = model.isSelect ? [UIImage imageNamed:@"luoshi_sel"] : [UIImage imageNamed:@"luoshi_unsel"];
    self.leftImageView.image = image;
    self.titleLabel.text = [NSString stringWithFormat:@"%d#", model.handSize];
    
    self.chargeLabel.hidden = model.isCurrent;
    self.moneyLabel.hidden = self.chargeLabel.hidden;
    self.leftImageView.hidden = self.chargeLabel.hidden;
    self.currentLabel.hidden = !self.leftImageView.hidden;
    
}

@end
